<template>
  <div>
    <el-table :data="loginLogTable" :header-cell-style="{'text-align':'center'}" ref="loginLogList"
              :cell-style="{'text-align':'center'}">
      <el-table-column prop="id" label="id" width="100"/>
      <el-table-column prop="adminId" label="管理员id" width="100"/>
      <el-table-column prop="ip" label="登录ip" width="400"/>
      <el-table-column label="经纬度坐标" width="175">
        <div slot-scope="scope">
          {{scope.row.latitude}}, {{scope.row.longitude}}
        </div>
      </el-table-column>
      <el-table-column prop="nickname" label="昵称" width="100"/>
      <el-table-column prop="device" label="登录设备" width="100"/>
      <el-table-column prop="city" label="登录区域" width="200"/>
      <el-table-column prop="created" label="登录时间" width="200"/>
    </el-table>
  </div>
</template>

<script>
export default {
  name: "managerLoginLog",
  data() {
    return {
      loginLogTable: []
    }
  },
  methods: {
    loadLoginLog() {
      this.axios.create(
          {'headers': {'Authorization': localStorage.getItem('adminJwt')}}
      ).get("http://localhost:9999/zx-ams/LoginLog/list").then((response) => {
        let jsonResult = response.data
        if (jsonResult.state === 200) {
          jsonResult = jsonResult.data;
          this.loginLogTable = jsonResult;
        }
      })
    }
  },
  mounted() {
    this.loadLoginLog();
  }
}
</script>

<style scoped>

</style>